//- Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. 
//- <https://www.chatopera.com>, Licensed under the Chunsong Public 
//- License, Version 1.0  (the "License"), https://docs.cskefu.com/licenses/v1.html
//- Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
//- Copyright (C) 2018-Jun. 2023 Chatopera Inc, <https://www.chatopera.com>
//- Licensed under the Apache License, Version 2.0
//- http://www.apache.org/licenses/LICENSE-2.0
form.layui-form(action='/service/quene/transfer/save.html', method='post')
    input(type='hidden', name='id', value='#{id}')
    .row(style='height:295px;')
        .col-lg-12
            .box
                .box-title
                    h1.site-h1(style='background-color:#FFFFFF;margin:0px;padding:0 0 4px 20px;') 请选择技能组
                .box-body(style='padding:0px 0px;position: relative;height:250px;overflow-y:auto;')
                    select.ukefu-form-multiple(multiple, name='skillid')
                        if skillGroups
                            for skill in skillGroups
                                - var agentNum = 0
                                if userList
                                    for agent in userList
                                        if skill.id && agent.organs[skill.id]
                                            - agentNum = agentNum + 1
                                option.uk_role(title= skill.name + "(" + agentNum + ")", class=({'this': skill.id == skillid}), style="margin:0px;padding:7px 0 7px 20px;color: #32c24d" value= skill.id)
                                    span(style="max-width: 120px;text-overflow: ellipsis;white-space: nowrap; overflow: hidden;float: left;margin: 0 3px") #{skill.name}
                                    | (#{agentNum})
        .layui-form-button
            .layui-button-block
                button.layui-btn(lay-submit, lay-filter='contactsForm') 转接
                button.layui-btn.layui-btn-original(type='button', onclick='closedPage()') 关闭
    script.
        function closedPage(){
                layer.closeAll("page")
            }
            layui.use('form', function(){
                var form = layui.form();
                //监听提交
                form.on('submit(contactsForm)', function(data){
                    if(!data.field.skillid){
                        layer.msg("请选择技能组");
                        return false
                    }
                });
            });